package com.dmall.framework.result;

import java.io.Serializable;
import java.util.List;

/**
 * EasyUIDataGrid返回结果集对象
 * @author Chen 2017/10/10
 */
public class PageResult<T> implements Serializable,Result {

    private Long total;//总记录数
    private List<T> rows;//当前页需要展示的数据集合
    private String errorMessage;

    public PageResult(Long total, List rows) {
        this.total = total;
        this.rows = rows;
    }

    public PageResult(String errorMessage) {
        this.errorMessage = errorMessage == null?"":errorMessage;
    }
    public Long getTotal() {
        return total;
    }

    public void setTotal(Long total) {
        this.total = total;
    }

    public List<T> getRows() {
        return rows;
    }

    public void setRows(List<T> rows) {
        this.rows = rows;
    }

    @Override
    public boolean isSuccess() {
        return this.rows != null;
    }
}
